import common from '@ohos.app.ability.common';
/**
 * 全局信息
 */
class GlobalInfo {
  set context(context: common.Context) {
    globalThis.context = context
  }

  get context(): common.Context {
    return globalThis.context
  }

  set bundleName(bundleName: string) {
    globalThis.bundleName = bundleName
  }

  get bundleName(): string {
    return globalThis.bundleName
  }

  set isLogin(isLogin: boolean) {
    globalThis.isLogin = isLogin
  }

  get isLogin(): boolean {
    return globalThis.isLogin
  }

  set screenWidth(screenWidth: number) {
    globalThis.screenWidth = screenWidth
  }

  get screenWidth(): number {
    return globalThis.screenWidth
  }
}

const globalInfo = new GlobalInfo()

export default globalInfo